package com.cloudcreativity.blyg.entity;

import com.cloudcreativity.blyg.utils.StrUtils;

public class OpenOrderGoods {

    private Long id;

    private Long lid;

    private String name;

    private long categoryOneId;

    private long categoryTwoId;

    //商品条码
    private String barCode;

    //单位id
    private int unitId;

    //单位
    private String unit;

    //品牌id
    private int brandId;

    //品牌名
    private String brandName;

    // 规格
    private String specName;

    //零售价
    private int price;

    //数量
    private float amount;

    //小计金额
    private double money;

    //库存
    private double stock;

    public Long getLid() {
        return lid;
    }

    public void setLid(Long lid) {
        this.lid = lid;
    }

    public double getStock() {
        return stock;
    }

    public void setStock(double stock) {
        this.stock = stock;
    }

    public double getMoney() {
        return money;
    }

    public void setMoney(float money) {
        this.money = money;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public long getCategoryOneId() {
        return categoryOneId;
    }

    public void setCategoryOneId(long categoryOneId) {
        this.categoryOneId = categoryOneId;
    }

    public long getCategoryTwoId() {
        return categoryTwoId;
    }

    public void setCategoryTwoId(long categoryTwoId) {
        this.categoryTwoId = categoryTwoId;
    }

    public String getBarCode() {
        return barCode;
    }

    public void setBarCode(String barCode) {
        this.barCode = barCode;
    }

    public int getUnitId() {
        return unitId;
    }

    public void setUnitId(int unitId) {
        this.unitId = unitId;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public int getBrandId() {
        return brandId;
    }

    public void setBrandId(int brandId) {
        this.brandId = brandId;
    }

    public String getBrandName() {
        return brandName;
    }

    public void setBrandName(String brandName) {
        this.brandName = brandName;
    }

    public String getSpecName() {
        return specName;
    }

    public void setSpecName(String specName) {
        this.specName = specName;
    }

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    public float getAmount() {
        return amount;
    }

    public void setAmount(float amount) {
        this.amount = amount;
    }

    public void calculate(){
        this.money = StrUtils.get2BitDecimal(price * amount);
    }

    public String formatMoney(){
        return String.valueOf(StrUtils.get2BitDecimal(this.money/100f));
    }
}
